<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="https://files.cnblogs.com/files/nnnnn/nncss.css" type="text/css" />
    <style>
        #nn-canvas {
            max-height: 1000px;
        }
    </style>
</head>

<body>
    <div class="container">
        <div id="nn-canvas" class="row nnp-mt2 nnb nnc-gray"></div>
    </div>
    <script src="http://git.oschina.net/60/nnCssFramework/raw/master/nnutils.js"></script>
    <script>
        window.onload = function () {
            nnCanvas.draw = function (ctx, w, h) {
                for (var i = 0; i < w / 2; i++) {
                    if (i % 10 == 0) {
                        ctx.beginPath();
                        ctx.rect(i, i, w - i * 2, w - i * 2);
                        this.style(this.randomColor(), 5);
                    }
                }
            };
            nnCanvas.render();
        };
    </script>
</body>

</html>